package com.zoho.daliansheng.controller;

import com.alibaba.fastjson.JSONObject;
import com.zoho.daliansheng.service.AccountService;
import com.zoho.daliansheng.utils.ResultUtil;
import org.springframework.web.bind.annotation.*;


@RestController
@RequestMapping("/account")
@CrossOrigin
public class AccountController {

    AccountService accountService;

    public AccountController(AccountService accountService) {
        this.accountService = accountService;
    }

    @PostMapping("/pushAccountToERP")
    public ResultUtil<Object> pushAccountToERP(@RequestBody JSONObject json) {
        return accountService.pushAccountToERP(json);
    }

    @PostMapping("/getERPAccount")
    public ResultUtil<Object> getERPAccount(@RequestBody JSONObject json) {
        return accountService.getERPAccount(json);
    }


    @PostMapping("/pushAccountContactToERP")
    public ResultUtil<Object> pushAccountContactToERP(@RequestBody JSONObject json) {
        return accountService.pushAccountContactToERP(json);
    }

    @PostMapping("/pushAddressToERP")
    public ResultUtil<Object> pushAddressToERP(@RequestBody JSONObject json) {
        return accountService.pushAddressToERP(json);
    }
}
